These scripts enable you to control several fields with one scroll bar. Any scroll bar can control all the others depending on which one you are moving at any given time. Just copy the script for field "field 1" into all fields you wish to make controllers.
You may wish to cover up the scroll bars you don't want people to use with opaque fields, as I have done with in field "field 3", so people don't use them by mistake.
You may notice that field "field 3" has lines on it, unlike the usual scrolling field. A transparent field with "Show Lines" checked will underline for you, but will also, unfortunately, prevent you from entering text into that field directly.
I have added an algorithm that aligns the top of the first line with the top of the field, so you won't stop the scroller with only part of the first line showing.
*** INSTALLATION INSTRUCTIONS ***
You MUST:
ΓÇó Put handlers "Open Card" and "ChangeScroll" into your card's script.
ΓÇó Put "mouseWithin" handler in all fields you want to use to control the others.
ΓÇó Change names of fields in card's script to the names of your fields.
P.S. I have made two other versions of this, if people show an interest:
> One of them tells you which line numbers are showing on screen, and how many total lines have been entered into the field; and
> The other works with buttons instead of scroll bars, moving up or down a line or a screen at a time.
Scroll Away.
Mark Safire
Safire Consulting
320 East 22, Apt 3-F
New York, NY 10010
GENIE: HyperSaf
on openCard
-- PUT NAME OF ANY FIELD IN PLACE OF "field 1" IN THIS HANDLER
-- (Or, alternately, "hard wire" this script by putting the text
-- height directly into handler "changeScroll")
global txtHt -- text height of scrolling fields
put the textHeight of card field "field 1" into txtHt
end openCard
on changeScroll scrHt
-- The first part of this handler prevents you from
-- scrolling between lines.
global txtHt
get scrHt MOD txtHt
if (it < txtHt/2) then subtract it from scrHt
else if (scrHt > 0) and (it > 0) then add (txtHt - it) to scrHt
-- This part scrolls all the fields to the same height.
-- PUT NAMES OF ALL YOUR FIELDS HERE: ADD AS MANY AS YOU WANT